<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE xsl:stylesheet SYSTEM "lang://blogs">

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<!-- TAGS CLOUD -->
	<xsl:template match="tags" mode="block-tags-cloud">
		<div id="tags">
			<xsl:for-each select="tag">
				<a class="tag">
					<xsl:attribute name="href">
						<xsl:value-of select="concat ($baseURI, '/blogs/tag/', value)" />
					</xsl:attribute>
					<xsl:attribute name="style">
						<xsl:value-of select="concat ('font-size: ', size, 'px')" />
					</xsl:attribute>
					<xsl:value-of select="value" />
				</a>
				<xsl:text> </xsl:text>
			</xsl:for-each>
		</div>
	</xsl:template>
	
	<!-- BLOCKS BLOCK -->
	<xsl:template match="response" mode="block-blogs">
		<div id="block_blogs">
			<xsl:if test="count (object) = 0">
				<xsl:text>&labelBlogsEmpty;</xsl:text>
			</xsl:if>
			<xsl:apply-templates seelct="response" />
			<div class="link">
				<a href="{$baseURI}/blogs/top">&labelBlogsRatingAll;</a>
			</div>
		</div>
	</xsl:template>
	
	<xsl:template match="object[@type='blog']">
		<xsl:param name="alias" select="property[@name='alias']/value" />
		
		<div class="item">
			<div class="rating">
				<xsl:if test="position() = 1">
					<span class="word">&labelRatingWord; </span>
				</xsl:if>
				<span>
					<xsl:value-of select="property[@name='rating']/value" />
				</span>
			</div>
			<div class="name">
				<a href="{$baseURI}/blog/{$alias}">
					<xsl:value-of select="property[@name='title']/value" />
				</a>
			</div>
		</div>
	</xsl:template>

</xsl:stylesheet>